﻿using System.Net;
using System.Net.Sockets;

namespace Odin.Execution.Utils
{
	public static class SocketHelper
	{
		public static int GetAvailablePort()
		{
			var listener = new TcpListener(IPAddress.Any, 0);
			listener.Start();
			var port = ((IPEndPoint) listener.LocalEndpoint).Port;
			listener.Stop();
			return port;
		}
	}
}
